﻿<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>:first-of-type选择器和:last-of-type选择器</title>
    <style type="text/css">
        h2:last-of-type{color:#f09;}
        p:first-of-type{color:#12ff65;}
    </style>
</head>
<body>
    <h2>李白</h2>
    <p>字太白，号青莲居士，唐代伟大的浪漫主义诗人。</p>
    <h2>杜甫</h2>
    <p>字子美，自号少陵野老，唐代伟大的现实主义诗人。</p>
    <h2>孟浩然</h2>
    <p>字浩然，号孟山人，唐代著名的山水田园派诗人。</p>
    <h2>李贺</h2>
    <p>字长吉， 唐朝中期的浪漫主义诗人。</p>
</body>
</html>
    
    
    
    
    